const std = @import("std");
const Reader = std.fs.File.Reader;

pub fn handle(extype: u8, len: u32, in: Reader) !void {
    return switch (extype) {
        0x00 => handleCommand(len, in),
        else => error.InvalidInput,
    };
}

pub fn handleCommand(len: u32, in: Reader) !void {
    var buf: u8[255] = undefined;

    const read_len = try in.readAll(buf[0..len]);
    if (read_len < len) return error.UnexpectedEOF;

    const payload = buf[0..len];
}
